import React, { Component } from "react";
import TodoItem from "./TodoItem";

export default class TodoList extends Component {
  render() {
    const { todos, title, del, change } = this.props;

    return (
      <div className="todo-list">
        <div className="todo-list__name">{title}</div>

        {todos.map((todo) => (
          <TodoItem key={todo.id} {...todo} del={del} aa={change} />
        ))}
      </div>
    );
  }
}
